
<!--
/**************************************************
* @ providerdetail.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/03/01, owen
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../common.jsp" %>
<%@page import="framework.core.Conditions"%>
<%@page import="framework.core.DBConnection"%>
<%@page import="framework.core.ObjectList"%>
<%@page import="system.base.ProductTypeManager"%>
<html>
<head>
<title>产品修改</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/hi-check.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>

<%
	ArrayList tManuf1 = (ArrayList)request.getAttribute("manufacture1");
	HashMap tMap1 = (HashMap)request.getAttribute("manufacturetyp2");
	String isPlanPrice = (String)request.getAttribute("isPlanprice");
	if(tMap1 != null){
	    System.out.println(""+tMap1.size());
	}else{
	    System.out.println("false");
	}
	HashMap tMap2 = (HashMap)request.getAttribute("manufacturetyp3");
	if(tMap2 != null){
	    System.out.println(""+tMap2.size());
	}else{
	    System.out.println("false");
	}
	    
	GSManufactureBean tBean = (GSManufactureBean)request.getAttribute("manufacturebean");
    String[] categoryStr = (String[])request.getAttribute("categorystr");
    String providerName = (String)request.getAttribute("providername");
    System.out.println(categoryStr[0]+""+categoryStr[1]+""+categoryStr[2]);

%>
<script language="JavaScript">
	
	var counter;
	function check(){
		
		if(document.all.gs_manufacture_unitprice.value == null || Trim(document.all.gs_manufacture_unitprice.value) == ""||parseFloat(document.all.gs_manufacture_unitprice.value)<=0||isNaN(document.all.gs_manufacture_unitprice.value)){
            alert("请输入产品单价");
            return false;
        }
        if(document.all.gs_quant_unit.value == null || Trim(document.all.gs_quant_unit.value) == ""){
            alert("请输入产品数量单位");
            return false;
        }
		checkform.action="<%= response.encodeURL(request.getContextPath() + "/A400307.do") %>";   
	    document.checkform.submit();
	}
    
    function back(){
		 //checkform.action="<%=root%>/A400301.do";   
	     //document.checkform.submit();
	      self.close();
	}
	
	function selectprovider(){
		var url = "<%= response.encodeURL(request.getContextPath() + "/A100106.do") %>";
		var returnv = window.open(url,null," edge: sunken ; center: Yes; help: No; resizable: No; status: Yes; dialogWidth: 840px ; dialogHeight: 720px ; scroll:yes");
		
	}
	
	function change1(optval){
  		var val = optval;
		if(val=='0'){
			var listbox = document.getElementById("manuftype2");
			listbox.length = 0;
			var option = new Option();
			option.text = "---二级---";
			option.value = "0";			
			listbox.options[listbox.length] = option;

		}else{
  	<%
  		if(tMap1 !=null){
	 	   	Collection tCollection = tMap1.keySet();
	        Iterator tIterator = tCollection.iterator();
  		       while(tIterator.hasNext()){
  		           String tKey = (String)tIterator.next();
  		           ArrayList tList = (ArrayList)tMap1.get(tKey);
  	%>
  				if(val == '<%=tKey%>'){
	  				var counter;
	  				var listbox = document.getElementById("manuftype2");
	  				listbox.length = 0;  		  	  	
							var option = new Option();
							option.value = "0";
							option.text = "---二级---";
							listbox.options[listbox.length] = option;			  											
	<%					
						for(int n=0;n<tList.size();n++){
						    GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean)tList.get(n);
						    String categoryId = tGSManufactureBean.getGs_manufacture_category_id();
						    String categoryName = tGSManufactureBean.getGs_manufacture_category_name();
	%>				
							var temp1 = '<%=categoryId%>';
							var temp2 = '<%=categoryName%>';
							var option = new Option();
							option.value = temp1;
							option.text = temp2;
							listbox.options[listbox.length] = option;						
	<%
						}
	%>
  				}
  	<%
  		    }
  		       
  		}
  	%>
  	}	
	}	
	function change2(optval){
  		var val = optval;
		if(val=='0'){
			var listbox = document.getElementById("manuftype3");
			listbox.length = 0;
			var option = new Option();
			option.text = "---三级---";
			option.value = "0";			
			listbox.options[listbox.length] = option;

		}else{
  	<%
  		if(tMap2 !=null){
	 	   	Collection tCollection = tMap2.keySet();
	        Iterator tIterator = tCollection.iterator();
  		       while(tIterator.hasNext()){
  		           String tKey = (String)tIterator.next();
  		           ArrayList tList = (ArrayList)tMap2.get(tKey);
  	%>
  				if(val == '<%=tKey%>'){
	  				var counter;
	  				var listbox = document.getElementById("manuftype3");
	  				listbox.length = 0;  		  	  	
			var option = new Option();
			option.text = "---三级---";
			option.value = "0";			
			listbox.options[listbox.length] = option;	  											
	<%					
						for(int n=0;n<tList.size();n++){
						    GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean)tList.get(n);
						    String categoryId = tGSManufactureBean.getGs_manufacture_category_id();
						    String categoryName = tGSManufactureBean.getGs_manufacture_category_name();
	%>				
							var temp1 = '<%=categoryId%>';
							var temp2 = '<%=categoryName%>';
							var option = new Option();
							option.value = temp1;
							option.text = temp2;
							listbox.options[listbox.length] = option;						
	<%
						}
	%>
  				}
  	<%
  		    }
  		       
  		}
  	%>
  	}		
	}
	function openwin(value){
		showModalDialog("<%=root%>/jsp/showimage.jsp?path="+value,window,"status:no;unadorned:yes;dialogWidth:375px;dialogHeight:400px;help:no;");
	}
</script>
</head>
<body BGCOLOR="#f2f2f2"	text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="checkform" action="A400304.do" method="post">
<p><br></p>
<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td height="20">
		<table width="100%" border="0" cellspacing="0" cellpadding="1">
			<tr height="20">
				<td height="20" width="1" class="mtxt_black">&nbsp;</td>
				<td height="30" width="758" class="mtxt_black">修改产品信息</td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td class="bg_line" height="2"></td>
	</tr>
</table>
<br>
<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=30>
					<TD class="bg_column" align=center width="20%">集中编码</TD>
					<TD align=left class="bg_row_odd" width="30%">
					 <%=tBean.getGs_concentricity()%>
					</TD>					
					<TD class="bg_column" align=center width="20%">产品编号</TD>
					<TD align=left class="bg_row_odd" width="30%">
					<%=tBean.getGs_manufacture_id()%>
					<input type="hidden" name="gs_manufacture_id" value="<%=tBean.getGs_manufacture_id() %>">
					</TD>					
				</TR>
				<TR height=30>
					<TD class="bg_column" align=center width="20%">产品名称</TD>
					<TD align=left class="bg_row_odd" width="30%">
					<%=tBean.getGs_manufacture_name()%>
					</TD>					
					<TD class="bg_column" align=center width="20%">供应商</TD>
					<TD align=left class="bg_row_odd" width="30%">
					   <%=GSBaseManager.getProviderName(tBean.getGs_provider_id())%>
					</TD>					
				</TR>
				<TR height=30>
					<TD class="bg_column" align=center>产品种类</TD>
					<TD align=left class="bg_row_odd">
						<%=GSBaseManager.getManufactureCategoryName(tBean.getGs_manufacture_category_id())%>
					</TD>	
					<TD class="bg_column" align=center width="20%">品牌</TD>
					<TD align=left class="bg_row_odd" width="30%">
					    <%=tBean.getGs_manufacture_brand()%>
					</TD>				
				</TR>
				<tr height=30>
					<TD class="bg_column" align=center>型号</TD>
					<TD align=left class="bg_row_odd" >
				      <%=tBean.getGs_manufacture_type()%>
					</TD>					
					<TD class="bg_column" align=center>规格</TD>
					<TD align=left class="bg_row_odd">
					  <%=tBean.getGs_manufacture_spec()%>
					</TD>					
				</TR>
				<TR height=30>
					<TD class="bg_column" align=center>产品单价</TD>
					<TD align=left class="bg_row_odd">
					<input type=text name="gs_manufacture_unitprice" maxlength="50" value='<%=tBean.getGs_manufacture_unitprice()%>' size=15/>元
					<input type="hidden" name="gs_recent_adjusted_price" value="<%=tBean.getGs_manufacture_unitprice()%>">
					
					</TD>					
					<TD class="bg_column" align=center>数量单位</TD>
					<TD align=left class="bg_row_odd">
					<input type=text name="gs_quant_unit" maxlength="100" value='<%=tBean.getGs_quant_unit()%>' size=30/>
					</TD>	
                    <%
                            if(isPlanPrice.equals("1")){
                        %>
                <TD class="bg_column" align=center>计划价</TD>
                    <TD align=left class="bg_row_odd"><input type="text" name="planprice" onblur="pricef(this);" value='<%=tBean.getPlan_price()%>'>&nbsp;元&nbsp; <font color=red>*</font></TD>                 
                    <TD class="bg_column" align=center></TD>
                    <TD align=left class="bg_row_odd"></TD>               
                </TR>
                        <%}%>				
					
                </TR>			
				<TR height=30>
					<TD class="bg_column" align=center>质保期</TD>
					<TD align=left class="bg_row_odd">
					<input type=text name="gs_quality_assure_period" maxlength="100" value='<%=tBean.getGs_quality_assure_period()%>' size=30/>
					</TD>					
					<TD class="bg_column" align=center>生产厂商</TD>
					<TD align=left class="bg_row_odd">
					 <%=tBean.getGs_manufacturer_name()%>
					</TD>					
				</TR>				
				<TR height=30>
					<TD class="bg_column" align=center>产地</TD>
					<TD align=left class="bg_row_odd">
					 <%=tBean.getGs_make_area()%>
					</TD>					
					<TD class="bg_column" align=center>产品图片</TD>
					<TD align=left class="bg_row_odd">
					
					</TD>					
				</TR>				
				<TR height=30>
					<TD class="bg_column" align=center>最近调价时间</TD>
					<TD align=left class="bg_row_odd">
					 <%=tBean.getGs_recent_adjustprice_date()%>
					</TD>					
					<TD class="bg_column" align=center>最近调价前价格</TD>
					<TD align=left class="bg_row_odd">
					 <%=tBean.getGs_recent_adjusted_price()%>元					
					</TD>					
				</TR>				
			    <TR height=30>
					<TD class="bg_column" align=center>附加属性</TD>
					<TD align=left class="bg_row_odd" colspan="3">
					  <%=tBean.getGs_adapt_machine_type()%>
					</TD>						
				 </TR>	
				 <TR height=30>
					<TD class="bg_column" align=center>备注</TD>
					<TD align=left class="bg_row_odd">
					 <%=tBean.getGs_remark()%>
					</TD>	
					<td class="bg_column" align=center>产品供应商分类</td>
					<td align=left class="bg_row_odd">
							<select name = "product_type">
								<%
									GSProductTypeDao dao = new GSProductTypeDao();
									GSProductTypeBean bean = dao.findProductTypeByProuductCode(tBean.getGs_concentricity());
									int type = 1;
									if(bean!=null){
										type = bean.getProductType();
									}
									Conditions condition = new Conditions();
									condition.add(" upper_type = '"+GSBaseConstants.PRODUCT_TYPE_MANAGER_USE+"' ");
									ObjectList list = ProductTypeManager.fetch().search(DBConnection.open(),condition);
									for(int i=0;i<list.size();i++){
									ProductTypeManager productType = (ProductTypeManager)list.get(i);
								 %>
										<option value="<%=productType.getProductType() %>" <%if(productType.getProductType().equals(String.valueOf(type))) {%> selected="selected"<%} %>><%=productType.getTypeName() %></option>
								<%
									}
								 %>
							</select>
					</td>					
				</TR>				
				<TR height=30>
					<TD class="bg_column" align=center>产品录入人员</TD>
					<TD align=left class="bg_row_odd">
					  <%=tBean.getGs_recorder_id()%>
					</TD>					
					<TD class="bg_column" align=center>产品录入时间</TD>
					<TD align=left class="bg_row_odd">
				       <%=tBean.getGs_manufacture_record_date()%>				
					</TD>					
				</TR>					
                <TR height=30>
                    <TD class="bg_column" align=center>有效性</TD>
                    <TD align=left class="bg_row_odd">
                      <%=GSBaseManager.getValidityName2(tBean.getGs_validity())%>
                    </TD>                   
                    <TD class="bg_column" align=center>结算模式</TD>
                    <TD align=left class="bg_row_odd">
                       <%=DefineDic.getBalanceMode(tBean.getGs_balance_mode())%>               
                    </TD>                   
                </TR>										
			</table>
		</td>
	</tr>
</table>
</form>
    <p align="center">  
		<input type="button" class="kuang" value="修改" onclick="return check();"> 
		<input type="button" class="kuang" value="关闭" onclick="return back();"/>&nbsp;		
    </p>
</body>
</html>